#ifndef TreeItem_Book_H
#define TreeItem_Book_H

#include "IBookListItem.h"

#include <QtSql/QSqlDatabase>
#include <QtSql/QSqlRecord>

namespace Jonathan
{

   class TreeItem_Book : public IBookListItem
   {
   public:
       TreeItem_Book                (QString dbPath,  QSqlDatabase db, QSqlRecord record, QTreeWidget *parent = 0);
       ~TreeItem_Book               ();
       QString GetBookDbPath        ();
       QString GetName              ();
       QString GetBookType          ();
       QString GetBookAuthor        ();
       QString GetBookAbbreviation  ();
       bool HasSubBooks             ();
       void LoadChildren            ();
       QSqlDatabase GetDatabase     ();
       BookItemType GetBookItemType () { return Jonathan::Book; }

   signals:

   private:
       QString                      m_DbPath;
       QString                      m_Name;
       QString                      m_Type;
       QString                      m_Abbreviation;
       QString                      m_Author;
       bool                         m_HasSubBooks;
       QSqlDatabase                 m_Database;

   };

}

#endif // TreeItem_Book_H
